<?php

class User_model extends MY_Model {

	public function __construct() {
		parent::__construct();
		$this->table = 'user';

		$this->as = 'u';

		$this->relations = array(
			array(
				'table' => 'permission_group',
				'as' => 'pg',
				'foreign' => 'id',
				'local' => 'permission_group',
				'type' => 'left'
			)
		);

		$this->columns = array(
			'*',
			array('pg.name','permission_group_name')
		);
	}
}
